package Control;

import java.util.Objects;

public class Car {
    private String id;
    private String timein;
    private String timeout;
    private String state;

    public Car(String id, String timein, String timeout, String state) {
        this.id = id;
        this.timein = timein;
        this.timeout = timeout;
        this.state = state;
    }

    public Car setId(String id) {
        this.id = id;
        return this;
    }

    public Car setTimein(String timein) {
        this.timein = timein;
        return this;
    }

    public Car setTimeout(String timeout) {
        this.timeout = timeout;
        return this;
    }

    public Car setState(String state) {
        this.state = state;
        return this;
    }

    public String getId() {
        return id;
    }

    public String getTimein() {
        return timein;
    }

    public String getTimeout() {
        return timeout;
    }

    public String getState() {
        return state;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Car car = (Car) o;
        return Objects.equals(id, car.id);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id);
    }

    @Override
    public String toString() {
        return "Car{" +
                "车牌号='" + id + '\'' +
                ", 进入时间='" + timein + '\'' +
                ", 出库时间='" + timeout + '\'' +
                ", 备注='" + state + '\'' +
                '}';
    }
}
